<%@ Page Language="VB" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="false" CodeFile="users.aspx.vb" Inherits="admin_users" title="Users" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">

<script type="text/javascript" language="javascript">
    function SetUploadHiddenField(roleDropDownListName, uploadHiddenFieldName) {
    
        var uploadHiddenField = document.getElementById(uploadHiddenFieldName);
        var roleDropDownList = document.getElementById(roleDropDownListName);
        var selectedItem = roleDropDownList.options[roleDropDownList.selectedIndex].value;
        
        if (selectedItem == '34003' || selectedItem == '34004') {
            uploadHiddenField.value = '1';
        } else {
            uploadHiddenField.value = '0';
        }
        
    }
    
     function SetAgencyVisible(roleDropDownListName,agencyButtonName)
     {
        var roleDropDownList = document.getElementById(roleDropDownListName);
        var selectedItem = roleDropDownList.options[roleDropDownList.selectedIndex].value;
    
     if (selectedItem == '34003' || selectedItem == '34004' || selectedItem=='34001' || selectedItem=='34002' || selectedItem=='34007') {
            document.getElementById(agencyButtonName).style.visibility = "visible";

        } else {
            document.getElementById(agencyButtonName).style.visibility = "hidden";
        }
     }
</script>
    
    <asp:ObjectDataSource ID="UsersObjectDataSource" runat="server" SelectMethod="ListBySort" SortParameterName="sortExpr"
        TypeName="Cdm.DataCore.UserSecurity.CDMUser" DataObjectTypeName="Cdm.DataCore.UserSecurity.CDMUser" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance">
    </asp:ObjectDataSource>
        
    <asp:ObjectDataSource ID="UserFormObjectDataSource" runat="server" SelectMethod="ListByUserID"
        TypeName="Cdm.DataCore.UserSecurity.CDMUser" DataObjectTypeName="Cdm.DataCore.UserSecurity.CDMUser" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance">
        <SelectParameters>
            <asp:ControlParameter ControlID="UsersScrollingGridView" DefaultValue="" Name="UserID" PropertyName="SelectedDataKey" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
        
    <asp:ObjectDataSource ID="RolesObjectDataSource" runat="server" SelectMethod="ListSpecial"
        TypeName="Cdm.DataCore.UserSecurity.Role" DataObjectTypeName="Cdm.DataCore.UserSecurity.Role" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance">
    </asp:ObjectDataSource>
        
    <asp:ObjectDataSource ID="CountiesObjectDataSource" runat="server" SelectMethod="ListAll"
        TypeName="Cdm.DataCore.LookupTables.LUCounty" DataObjectTypeName="Cdm.DataCore.LookupTables.LUCounty" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance">
    </asp:ObjectDataSource>

    <asp:Panel ID="FindUserPanel" runat="server" Visible="false">

        <table border="0" cellpadding="0" cellspacing="0">
            <tr > <td style="width:10px;"></td>
                <td style="width:415px;"><h1>Admin - Users</h1>
                <span style="font-family:MS Sans Serif, Arial, Verdana, Sans-Serif; font-size:9px; font-weight:bold;">Add a user or search for users by name or role.</span></td>
                 <td style="width:10px;">&nbsp;</td>
                <td style="width:415px;">&nbsp;</td>
                <td style="width:10px;">&nbsp;</td></tr>
            <tr>
                <td style="width:10px;">&nbsp;</td>
                <td style="width:415px;"><cc2:TextInputControl ID="LastNameTextBox" runat="server" cssClassControl="formSmall" cssClassLabel="labelSmall" Title="Last Name" /></td>
                <td style="width:10px;">&nbsp;</td>
                <td style="width:415px;"><cc2:TextInputControl ID="FirstNameTextBox" runat="server" cssClassControl="formSmall" cssClassLabel="labelSmall" Title="First Name" /></td>
                <td style="width:10px;">&nbsp;</td>
            </tr>
            <tr>
                <td style="width:10px;">&nbsp;</td>
                <td valign="middle"><cc2:DropDownInputContol ID="RoleDropDownList" runat="server" cssClassControl="formSelectSmall" AutoPostBack="false" DataValueField="RoleId" DataTextField="RoleDisplayName" cssClassLabel="labelSmall" Title="Role" />
                
                </td>
                <td style="width:10px;" valign="bottom"><asp:Button ID="SubmitRoleButton" runat="server" Text="Agencies" Style="visibility:hidden" /></td>
                <td ><cc2:DropDownInputContol ID="AgencyDropDownList" runat="server" cssClassControl="formSelectSmall" DataValueField="ID" DataTextField="Description" cssClassLabel="labelSmall" Title="Agency" /></td>
                <td style="width:10px;">&nbsp;</td>
            </tr>
            <tr>
                <td style="width:10px;">&nbsp;</td>
                <td colspan="2">
                    <asp:Button ID="SearchButton" runat="server" Text="Search" />
                    <asp:Button ID="AddButton" runat="server" Text="Add User"/>
                </td>
                <td style="width:10px;">&nbsp;</td>
                <td colspan="2">&nbsp;</td>
                <td style="width:10px;">&nbsp;</td>
            </tr>
        </table>

        <cc2:ScrollingGridView ID="UsersScrollingGridView" runat="server" CssClass="gridOffset" IsFixedColumn="true" AutoGenerateColumns="False" ToolTip="210"
                DataKeyNames="UserID, RoleID" 
                CellPadding="5" BorderColor="#21334B" BorderStyle="Solid" 
                GridLines="Vertical" AllowSorting="True" Visible="false"
                EmptyDataText="There were no matching users found." >
                <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
                <RowStyle CssClass="adminColumnStyle" />
                <Columns>
                    <asp:BoundField DataField="DisplayLastNameFirst" SortExpression="LastName,FirstName" HeaderText="User" HeaderStyle-Width="245px" ItemStyle-Width="230px" />
                    <asp:BoundField DataField="EmailAddress" SortExpression="EmailAddress" HeaderText="Email" HeaderStyle-Width="180px" ItemStyle-Width="180px" />
                    <asp:BoundField DataField="logonid" SortExpression="logonid" HeaderText="ID" HeaderStyle-Width="80px" ItemStyle-Width="80px" />
                    <asp:BoundField DataField="status" SortExpression="status" HeaderText="Status" HeaderStyle-Width="100px">
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Role" SortExpression="RoleID">
                    <HeaderStyle Width="100px" />
                    <ItemStyle Width="100px" />
                        <ItemTemplate><asp:label ID="role" runat="server" Text='<%#DisplayRole(Eval("RoleID"))%>'></asp:label></ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" HeaderText="Action" AccessibleHeaderText="Action">
                        <ItemStyle HorizontalAlign="Center" Width="80px" />
                        <HeaderStyle Width="110px" />
                    </asp:CommandField>
                </Columns>
                <EmptyDataRowStyle CssClass="alert" />
                <AlternatingRowStyle BackColor="#E8ECF4" />
</cc2:ScrollingGridView>
    </asp:Panel>
     <br />
    <asp:Label ID="ErrorSummary" runat="server" CssClass="alertFont" />
    <br />
        
 <asp:Panel ID="panelChangeRoleVerification" runat="server" Visible="false" Enabled="true" CssClass="alert" HorizontalAlign="Center" Wrap="true">
            <asp:Label ID="ChangeRoleSummaryLabel" CssClass="alert" runat="server" Text="Are you sure you want to edit the current role for this user?" />
            <br />
            <asp:Button ID="ConfirmRoleChangeButton" runat="server" Text="Yes" Enabled="true" />
            <asp:Button ID="CancelRoleChangeButton" runat="server" Text="No" Enabled="true" />
        </asp:Panel>

    
<%--    <span style="position:absolute; left:-50px; top:65px;">--%>

<asp:Panel ID="AddEditUserPanel" runat="server" Visible="false" Height="200px" ScrollBars="Auto" ToolTip="110">
    <table border="0" cellpadding="0" cellspacing="0" width="800px">
        <tr>
        <td>
        <asp:FormView ID="UserFormView" runat="server" DataSourceID="UserFormObjectDataSource" DataKeyNames="UserId" Width="825px" HorizontalAlign="Center" Visible="False">
            <InsertItemTemplate>     
                <table border="0">
                    <tr style="font-family:MS Sans Serif, Arial, Verdana, Sans-Serif; font-size:9px; font-weight:bold;">
                        <td colspan="7">Add a new user.</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label2" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtLName">Last Name<font color="red">*</font>:</asp:Label>
                        <td><asp:TextBox ID="txtLName" runat="server" CssClass="formSmall" Text='<%# Bind("LastName") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label14" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtFName">First Name<font color="red">*</font></asp:Label></td>
                        <td><asp:TextBox ID="txtFName" runat="server" CssClass="formSmall" Text='<%# Bind("FirstName") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>                 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label16" runat="server" CssClass="labelSmall" AssociatedControlID="txtMName">Middle Name:</asp:Label></td>
                        <td><asp:TextBox ID="txtMName" runat="server" CssClass="formSmall" Text='<%# Bind("MiddleName") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label6" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtSA1">Street Address 1<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="txtSA1" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddress1") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label25" runat="server" CssClass="labelSmall" AssociatedControlID="txtSA2">Street Address 2:</asp:Label></td>
                        <td><asp:TextBox ID="txtSA2" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddress2") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label34" runat="server" CssClass="labelSmall" AssociatedControlID="txtSA3">Street Address 3:</asp:Label></td>
                        <td><asp:TextBox ID="txtSA3" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddress3") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label35" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtSACity">City<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="txtSACity" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddressCity") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label36" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtSAState">State<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="txtSAState" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddressState") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label42" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtSAZip">Zip Code<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="txtSAZip" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddressZip") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td> <asp:Label ID="Label17" runat="server" Text="County:" CssClass="labelSmall" AssociatedControlID="ddlCounty"></asp:Label></td>
                        <td><asp:DropDownList ID="ddlCounty" CssClass="formSelectSmall" runat="server" DataSourceID="CountiesObjectDataSource" DataTextField="Description" DataValueField="CountyID" /></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="LabelAgencyAddress" runat="server" Text="" CssClass="labelSmallCheckbox" AssociatedControlID="CheckBoxAgencyAddress"></asp:Label></td>
                        <td><asp:CheckBox ID="CheckBoxAgencyAddress" runat="server" Text="Use Agency Address" AutoPostBack="true" CssClass="labelSmallCheckbox" OnCheckedChanged="CheckBoxAgencyAddress_CheckedChanged" /></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label3" runat="server" Text="" CssClass="labelSmallCheckbox" AssociatedControlID="CheckBoxMailingAddress"></asp:Label></td>
                        <td><asp:CheckBox ID="CheckBoxMailingAddress" runat="server" Text="Use as Mailing Address" AutoPostBack="true" CssClass="labelSmallCheckbox" OnCheckedChanged="CheckBoxMailingAddress_CheckedChanged" /></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label18" runat="server" Text="Mailing Address 1:" CssClass="labelSmall" AssociatedControlID="txtMA1"></asp:Label></td>
                        <td><asp:TextBox ID="txtMA1" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddress1") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label44" runat="server" Text="Mailing Address 2:" CssClass="labelSmall" AssociatedControlID="txtMA2"></asp:Label></td>
                        <td><asp:TextBox ID="txtMA2" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddress2") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label45" runat="server" Text="Mailing Address 3:" CssClass="labelSmall" AssociatedControlID="txtMA3"></asp:Label></td>
                        <td><asp:TextBox ID="txtMA3" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddress3") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label46" runat="server" Text="Mailing Address City:" CssClass="labelSmall" AssociatedControlID="txtMACity"></asp:Label></td>
                        <td><asp:TextBox ID="txtMACity" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddressCity") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label47" runat="server" Text="Mailing Address State:" CssClass="labelSmall" AssociatedControlID="txtMAState"></asp:Label></td>
                        <td><asp:TextBox ID="txtMAState" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddressState") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label48" runat="server" Text="Mailing Address Zip Code:" CssClass="labelSmall" AssociatedControlID="txtMAZip"></asp:Label></td>
                        <td><asp:TextBox ID="txtMAZip" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddressZip") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td colspan="2"><cc2:PhoneInputControl ID="InputTelephoneNumber" cssClassLabel="labelSmall" Title="Telephone #" runat="server" Value='<%# Bind("PhoneNumber") %>' Editable="true" /></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td colspan="2"><cc2:PhoneInputControl ID="InputFaxNumber" cssClassLabel="labelSmall" Title="Fax #" runat="server" Value='<%# Bind("FaxNumber") %>' Editable="true" /></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label20" runat="server" Text="Email:" CssClass="labelSmall" AssociatedControlID="txtEmail"></asp:Label></td>
                        <td><asp:TextBox ID="txtEmail" runat="server" CssClass="formSmall" Text='<%# Bind("EmailAddress") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label22" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="txtLogon">Logon ID<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="txtLogon" runat="server" CssClass="formSmall" Text='<%# Bind("LogonId") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label1" runat="server" Text="Password:" CssClass="labelSmall" AssociatedControlID="txtPassword"></asp:Label></td>
                        <td><asp:TextBox ID="txtPassword" runat="server" CssClass="formSmall" MaxLength="50" Text='<%# Bind("Password") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label23" runat="server" CssClass="labelSmall" Font-Bold="true"  AssociatedControlID="ddlStatus">Status<font color="red">*</font>:</asp:Label></td>
                        <td>
                            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="formSelectSmall">
                                <asp:ListItem Value="Active" Text="Active"></asp:ListItem>
                                <asp:ListItem Value="Inactive" Text="Inactive"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label9" runat="server" CssClass="labelSmall" Font-Bold="true"  AssociatedControlID="ddlRole">User Type<font color="red">*</font>:</asp:Label></td>
                        <td><asp:DropDownList ID="ddlRole" CssClass="formSelectSmall" runat="server" DataTextField="RoleDisplayName" DataValueField="RoleID" /></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                </table>
                
            </InsertItemTemplate>
            <EditItemTemplate>

                <table border="0">
                    <tr style="font-family:MS Sans Serif, Arial, Verdana, Sans-Serif; font-size:9px; font-weight:bold;">
                        <td colspan="7">Edit user information.</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label15" runat="server" CssClass="labelSmall" Font-Bold="true"  AssociatedControlID="editLName">Last Name<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editLName" runat="server" CssClass="formSmall" Text='<%# Bind("LastName") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label14" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="editFName">First Name<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editFName" runat="server" CssClass="formSmall" Text='<%# Bind("FirstName") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr> 
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label16" runat="server" CssClass="labelSmall" AssociatedControlID="editLName">Middle Name:</asp:Label></td>
                        <td><asp:TextBox ID="editMName" runat="server" CssClass="formSmall" Text='<%# Bind("MiddleName") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label6" runat="server" CssClass="labelSmall" Font-Bold="true"  AssociatedControlID="editSA1">Street Address 1<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editSA1" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddress1") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label25" runat="server" CssClass="labelSmall" AssociatedControlID="editSA2">Street Address 2:</asp:Label></td>
                        <td><asp:TextBox ID="editSA2" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddress2") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label34" runat="server" CssClass="labelSmall" AssociatedControlID="editSA3">Street Address 3:</asp:Label></td>
                        <td><asp:TextBox ID="editSA3" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddress3") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label35" runat="server" CssClass="labelSmall" Font-Bold="true"  AssociatedControlID="editSACity">City<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editSACity" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddressCity") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label36" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="editSAState">State<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editSAState" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddressState") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label42" runat="server" CssClass="labelSmall" Font-Bold="true" AssociatedControlID="editSAZip">Zip Code<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editSAZip" runat="server" CssClass="formSmall" Text='<%# Bind("StreetAddressZip") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label17" runat="server" Text="County:" CssClass="labelSmall" AssociatedControlID="ddleditCounty"></asp:Label></td>
                        <td><asp:DropDownList ID="ddleditCounty" CssClass="formSelectSmall" runat="server"></asp:DropDownList></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="LabelEditAgencyAddress" runat="server" Text="" CssClass="labelSmallCheckbox" AssociatedControlID="CheckBoxEditAgencyAddress"></asp:Label></td>
                        <td><asp:CheckBox ID="CheckBoxEditAgencyAddress" runat="server" Text="Use Agency Address" AutoPostBack="true" CssClass="labelSmallCheckbox" OnCheckedChanged="CheckBoxAgencyAddress_CheckedChanged" /></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label3" runat="server" Text="" CssClass="labelSmallCheckbox" AssociatedControlID="CheckBoxEditMailingAddress"></asp:Label></td>
                        <td><asp:CheckBox ID="CheckBoxEditMailingAddress" runat="server" Text="Use as Mailing Address" AutoPostBack="true" CssClass="labelSmallCheckbox" OnCheckedChanged="CheckBoxEditMailingAddress_CheckedChanged" /></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label18" runat="server" Text="Mailing Address 1:" CssClass="labelSmall" AssociatedControlID="editMA1"></asp:Label></td>
                        <td><asp:TextBox ID="editMA1" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddress1") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label44" runat="server" Text="Mailing Address 2:" CssClass="labelSmall" AssociatedControlID="editMA2"></asp:Label></td>
                        <td><asp:TextBox ID="editMA2" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddress2") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label45" runat="server" Text="Mailing Address 3:" CssClass="labelSmall" AssociatedControlID="editMA3"></asp:Label></td>
                        <td><asp:TextBox ID="editMA3" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddress3") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label46" runat="server" Text="Mailing Address City:" CssClass="labelSmall" AssociatedControlID="editMACity"></asp:Label></td>
                        <td><asp:TextBox ID="editMACity" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddressCity") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label47" runat="server" Text="Mailing Address State:" CssClass="labelSmall" AssociatedControlID="editMAState"></asp:Label></td>
                        <td><asp:TextBox ID="editMAState" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddressState") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label48" runat="server" Text="Mailing Address Zip Code:" CssClass="labelSmall" AssociatedControlID="editMAZip"></asp:Label></td>
                        <td><asp:TextBox ID="editMAZip" runat="server" CssClass="formSmall" Text='<%# Bind("MailingAddressZip") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td colspan="2"><cc2:PhoneInputControl ID="InputEditTelephoneNumber" cssClassLabel="labelSmall" Title="Telephone #" runat="server" Value='<%# Bind("PhoneNumber") %>' Editable="true" /></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td colspan="2"><cc2:PhoneInputControl ID="InputEditFaxNumber" cssClassLabel="labelSmall" Title="Fax #" runat="server" Value='<%# Bind("FaxNumber") %>' Editable="true" /></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label20" runat="server" Text="Email:" CssClass="labelSmall" AssociatedControlID="editEmail"></asp:Label></td>
                        <td><asp:TextBox ID="editEmail" runat="server" CssClass="formSmall" Text='<%# Bind("EmailAddress") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label22" runat="server" Font-Bold="true" CssClass="labelSmall" AssociatedControlID="editLogon">Logon Id<font color="red">*</font>:</asp:Label></td>
                        <td><asp:TextBox ID="editLogon" runat="server" CssClass="formSmall" Text='<%# Bind("LogonId") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label1" runat="server" Text="Password:" CssClass="labelSmall" AssociatedControlID="editPassword"></asp:Label></td>
                        <td><asp:TextBox ID="editPassword" runat="server" CssClass="formSmall" MaxLength="50" Text='<%# Bind("Password") %>'></asp:TextBox></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label23" runat="server" Text="Status:" CssClass="labelSmall" AssociatedControlID="ddleditStatus"></asp:Label></td>
                        <td>
                            <asp:DropDownList ID="ddleditStatus" runat="server" CssClass="formSelectSmall">
                                <asp:ListItem Value="Active" Text="Active"></asp:ListItem>
                                <asp:ListItem Value="Inactive" Text="Inactive"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width:20px;">&nbsp;</td>
                        <td><asp:Label ID="Label9" runat="server" Text="User Type:" CssClass="labelSmall" AssociatedControlID="ddleditRole" /></td>
                        <td><asp:DropDownList ID="ddleditRole" CssClass="formSelectSmall" runat="server" AutoPostBack="false" DataTextField="RoleDisplayName" DataValueField="RoleID" /></td>
                        <td style="width:20px;">&nbsp;</td>
                        <td colspan="2">&nbsp;</td>
                        <td style="width:20px;">&nbsp;</td>
                    </tr>

                </table>              
            </EditItemTemplate>
            </asp:FormView>
            </td>
        </tr>
        <tr>
            <td>
                <input type="hidden" runat="server" id="UploadHiddenField" />
            </td>
        </tr>
        </table>
         </asp:Panel>
        <asp:ObjectDataSource ID="odsCounties" runat="server" SelectMethod="ListAll" TypeName="Cdm.DataCore.LookupTables.LuCounty"></asp:ObjectDataSource>
          
    <asp:ObjectDataSource ID="odsSBA" runat="server" DataObjectTypeName="Cdm.DataCore.Entities.SupportBrokerAgency" TypeName="Cdm.DataCore.Entities.SupportBrokerAgency"
        SelectMethod="ListAll" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance"></asp:ObjectDataSource>
            
    <asp:ObjectDataSource ID="odsFMSA" runat="server" DataObjectTypeName="Cdm.DataCore.Entities.FMSA" TypeName="Cdm.DataCore.Entities.FMSA"
        SelectMethod="ListAll" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance"></asp:ObjectDataSource>
            
    <asp:ObjectDataSource ID="odsLocal" runat="server" DataObjectTypeName="Cdm.DataCore.Entities.LocalProgram" TypeName="Cdm.DataCore.Entities.LocalProgram"
        SelectMethod="ListAll" UpdateMethod="UpdateInstance" InsertMethod="SaveInstance"></asp:ObjectDataSource>
            
        <asp:Panel ID="pnlAgency" runat="server" Visible="false">
            <asp:HiddenField ID="hfRole" runat="server" />
            <asp:HiddenField ID="hfUserId" runat="server" />
            <asp:HiddenField ID="hfRoleChangeVerified" runat="server" Value="false" />
            <asp:HiddenField ID="hfSortExpression" runat="server" />
            <asp:HiddenField ID="hfSortDirection" runat="server" />
            <asp:HiddenField ID="hfQueryString" runat="server" />
            <asp:HiddenField ID="hfUseAgencyAddress" runat="server" Value="false" />
            <asp:HiddenField ID="hfUseAsMailingAddress" runat="server" Value="false" />
            <br />
            <asp:Label ID="lblProvider" CssClass="labelSmall" runat="server" Text="Medicaid Provider #:" Visible="false" />
            <asp:TextBox ID="txtProvider" CssClass="formSmall" runat="server" Visible="false" MaxLength="15" />
                <asp:Panel ID="UploadPanel" runat="server">
                    <table border="0" cellpadding="3" cellspacing="0" width="800px">
                        <tr>
                            <td valign="top" align="right" style="width: 203px">
                                <asp:Label ID="UploadLabel" runat="server" Text="Upload Support Broker Additional Information:"></asp:Label>
                            </td>
                            <td valign="top" style="width: 597px">
                                <asp:FileUpload runat="server" ID="NewFileUploadControl" Width="400px"></asp:FileUpload>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>            
                <table border="0" cellpadding="3" cellspacing="0" width="800px">
                    <tr>
                        <td valign="top" align="right" style="width: 200px"><asp:Label ID="lblAssign" runat="server" Text="Assign Agency" /></td>
                        <td valign="top" style="width: 600px"><asp:DropDownList ID="ddlAgency" runat="server" AutoPostBack="false" /></td>
                    </tr>
                    <tr>
                        <td style="width: 200px"></td>
                        <td style="width: 600px" valign="top"><asp:Button ID="btnAssign" runat="server" Text="Assign" /></td>
                    </tr>
                </table>
       </asp:Panel>
        
    
       
    
</asp:Content>

<asp:Content ID="FixedHeaderContent" runat="server" ContentPlaceHolderID="ContentPlaceHolderFixedAdmin">
    <table border="0" cellpadding="3" cellspacing="0"><tr><td> <asp:Button ID="SubmitButton" runat="server" Text="Submit" Visible="false" /></td><td><asp:Button ID="CancelButton" runat="server" Text="Cancel" Visible="false" /></td><td><asp:Label ID="lblRequired" runat="server" Text="Fields marked with an asterisk(*) are required." CssClass="alert" Visible="false" /></td></tr></table>
</asp:Content>

